package exception;

/**
 * finally块
 */
public class FinallyDemo {
    public static void main(String[] args) {
        System.out.println("开始...");

        try{
            String s = "";
            System.out.println(s.charAt(0));
            String s1 = "1";
            System.out.println(Integer.parseInt(s1));
            return;
        }catch(Exception e){
            System.out.println("代码出错了");
        }finally{
            System.out.println("继续执行");
            String s3 = "hello";
            System.out.println(s3);
        }

        System.out.println("结束...");














        System.out.println("开始了...");

        try{
            String line = "";
            System.out.println(line.charAt(0));
            return;
        }catch(Exception e){
            System.out.println("出错并解决了");
        }finally{
            System.out.println("到我执行了...");
            String s = "又是美好的一天";
            System.out.println(s);
        }
        System.out.println("结束了");
    }
}
